package com.lxd.kyvideo.controller.frontend;

import com.lxd.kyvideo.common.ApiResult;
import com.lxd.kyvideo.pojo.Carousel;
import com.lxd.kyvideo.service.CarouselService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/api/carousel")
public class FCarouselController {

    @Resource
    private CarouselService carouselService;


    @GetMapping("/top/{num}")
    public ApiResult topList(@PathVariable("num") Integer num){
        List<Carousel> carouselList = carouselService.findByLimit(num);
        return ApiResult.ok(carouselList);
    }
}
